from rest_framework import pagination
from rest_framework.response import Response


class MetaFieldPagination(pagination.LimitOffsetPagination):
    max_limit = 100

    def get_paginated_response(self, data):
        return Response({
            'meta': {
                'count': self.count,
                'next': self.get_next_link(),
                'prev': self.get_previous_link(),
                'limit': self.limit,
                'offset': self.offset,
            },
            'data': data
        })
